[#macro pageBar currentPage totalRow pageSize actionUrl urlParas="" showdivide="yes"]
[#local totalPage = (totalRow!0 - 1)/pageSize!1 + 1]
[#if (totalPage?int > 1) || (currentPage?int > totalPage?int)]
[#if (totalPage <= 0) || (currentPage > totalPage)][#return][/#if]
[#local startPage = currentPage - 2]
[#if (startPage < 1)][#local startPage = 1][/#if]
[#local endPage = currentPage + 2]
[#if (endPage > totalPage)][#local endPage = totalPage][/#if]
    <nav aria-label="Page navigation example">
        <ul class="pagination justify-content-center">
        [#if (currentPage <= 3)]
        [#local startPage = 1]
        [/#if]
        [#if ((totalPage - currentPage) < 2)]
        [#local endPage = totalPage]
        [/#if]

        [#if (currentPage?int == 1)]
        [#else]
          <li class="page-item"><a class="page-link" href="${actionUrl}[#if urlParas??]${urlParas!}[/#if]-p-1">&lt;&lt;</a></li>
          <li class="page-item"><a class="page-link" href="${actionUrl}[#if urlParas??]${urlParas!}[/#if]-p-#{currentPage?int - 1}">&lt;</a></li>
            [/#if]

            [#list startPage..endPage as i]
            [#if currentPage?int == i]
            <li class="page-item active"><a class="page-link">#{i}</a></li>
            [#else]
            <li class="page-item"><a class="page-link" href="${actionUrl}[#if urlParas??]${urlParas!}[/#if]-p-#{i}">#{i}</a></li>
            [/#if]
            [/#list]

            [#if (currentPage?int == totalPage?int)]
            [#else]
          <li class="page-item"><a class="page-link" href="${actionUrl}[#if urlParas??]${urlParas!}[/#if]-p-#{currentPage?int + 1}">&gt;</a></li>
          <li class="page-item"><a class="page-link" href="${actionUrl}[#if urlParas??]${urlParas!}[/#if]-p-#{totalPage?int}">&gt;&gt;</a></li>
        [/#if]
        </ul>
    </nav>
[/#if]
[/#macro]